<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>学生信息</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
#tab1 th td {
	text-align: center;
}
</style>
<script type="text/javascript">
	$("del").click(function() {
		var stuid = ${stu.stuid};
		$.ajax({
			type : "post",
			url : "/stu/delete",
			dataType : "json",
			contentType : "application/json;charset=gbk",
			data : JSON.stringify(stuid), //这个方法是将json的字符串形式转换成json对象，后台接收到的时候是一个整体的对象，而不是字符串。
			success : function(data) {
			
			}
		});
	});
</script>
</head>

<body>
	<table id="tab1" border="1">
		<tr>
			<th>编号</th>
			<th>姓名</th>
			<th>性别</th>
			<th>电话</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${stuList }" var="stu">
			<tr>
				<td>${stu.stuid }</td>
				<td>${stu.stuname }</td>
				<td>${stu.stusex }</td>
				<td>${stu.stunumber }</td>
				<td><a id="del">删除</a></td>
			</tr>
		</c:forEach>
	</table>
	<br>
</body>
</html>
